
use "C:\'your directory'\EU31 School & components.dta"

* Figure 1
xtset iso monthyear
xtline cindex1


***Third wave date2>22283 (i.e. January 2021)
use "C:\'your directory'\EU31.dta"

xtset iso date 

** Table 1
xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated totaldeathspermillion newtest1000, pairwise
reg newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated  totaldeathspermillion newtest1000 i.iso
xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated  totaldeathspermillion newtest1000 i.iso, pairwise

** Table 2
* Imbalance & matching
imb l7newcasespermillion l7others75 l7fullyvaccinated totaldeathspermillion , treatment( l7school75)
cem l7newcasespermillion l7others75 l7fullyvaccinated totaldeathspermillion , treatment( l7school75)

**Table 3
xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated  totaldeathspermillion newtest1000 [iweight= cem_weights], pairwise
reg newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated  totaldeathspermillion newtest1000 i.iso [iweight= cem_weights]
xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated  totaldeathspermillion newtest1000 i.iso [iweight= cem_weights], pairwise

* With political controls instead of country dummies
xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated totaldeathspermillion newtest1000 urbanization logpop density hdi ruleoflaw regulatoryquality trust20, pairwise

xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated  totaldeathspermillion newtest1000 urbanization logpop density hdi ruleoflaw regulatoryquality trust20 [iweight= cem_weights], pairwise

* Keeping continuous variables
xtpcse newcasespermillion l7newcasespermillion l7cindex1 l7cothers l7fullyvaccinated totaldeathspermillion newtest1000, pairwise
reg newcasespermillion l7newcasespermillion l7cindex1 l7cothers l7fullyvaccinated  totaldeathspermillion newtest1000 i.iso
xtpcse newcasespermillion l7newcasespermillion l7cindex1 l7cothers l7fullyvaccinated  totaldeathspermillion newtest1000 i.iso, pairwise

imb l7newcasespermillion l7cothers l7fullyvaccinated totaldeathspermillion , treatment( l7school75)
cem l7newcasespermillion l7cothers l7fullyvaccinated totaldeathspermillion , treatment( l7school75)

xtpcse newcasespermillion l7newcasespermillion l7cindex1 l7cothers l7fullyvaccinated  totaldeathspermillion newtest1000 [iweight= cem_weights], pairwise
reg newcasespermillion l7newcasespermillion l7cindex1 l7cothers l7fullyvaccinated  totaldeathspermillion newtest1000 i.iso [iweight= cem_weights]
xtpcse newcasespermillion l7newcasespermillion l7cindex1 l7cothers l7fullyvaccinated  totaldeathspermillion newtest1000 i.iso [iweight= cem_weights], pairwise


* More radical matching (only 28 countries in the balanced sample)
xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated l7positivity totaldeathspermillion newtest1000, pairwise
reg newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated l7positivity totaldeathspermillion newtest1000 i.iso
xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated l7positivity totaldeathspermillion newtest1000 i.iso, pairwise

imb l7newcasespermillion l7others75 l7fullyvaccinated l7positivity totaldeathspermillion , treatment( l7school75)
cem l7newcasespermillion l7others75 l7fullyvaccinated l7positivity totaldeathspermillion , treatment( l7school75)

xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated l7positivity totaldeathspermillion newtest1000 [iweight= cem_weights], pairwise
reg newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated l7positivity totaldeathspermillion newtest1000 i.iso [iweight= cem_weights]
xtpcse newcasespermillion l7newcasespermillion l7school75 l7others75 l7fullyvaccinated l7positivity totaldeathspermillion newtest1000 i.iso [iweight= cem_weights], pairwise



